USE DeltaFlex
GO

IF(OBJECT_ID('dbo.sp_CercarClientArticlePreu')IS NOT NULL)
	DROP PROCEDURE dbo.sp_CercarClientArticlePreu
GO

CREATE PROCEDURE dbo.sp_CercarClientArticlePreu
				  @IDCLIENT  int,
				  @IDARTICLE int

AS 
BEGIN 
	SET NOCOUNT ON
	IF @IDARTICLE = 0
		SELECT *
		  FROM CLIENT_ARTICLE_PREU 
		  WHERE IDCLIENT = @IDCLIENT
	ELSE
		SELECT *
		  FROM CLIENT_ARTICLE_PREU 
		 WHERE IDCLIENT = @IDCLIENT
		   AND IDARTICLE = @IDARTICLE 
END
GO
